package com.hanamaki.struct;

public class While5 {
    public static void main(String[] args) {

//        2006年培养学员8万人，每年增长25%，请问按此增长速度，到哪一年培训学员人数将达到20万人？
        /**
         * 06  8
         * 07  (8*25%)+8
         */

        int year = 2006;
        int personCount = 8;
        while (personCount <= 20) {
            year++;
            personCount += personCount * 0.25;
        }
        System.out.println(year);


        int year1 = 2006;
        int personCount1 = 8;
        while (true) {
            year1++;
            personCount1 += personCount1 * 0.25;
            if (personCount1 >= 20) {
                break;
            }
        }

        System.out.println(year1);





    }

}
